import {createApp} from 'vue'
import './style.css'
import App from './App.vue'
import './assets/system-icons/iconfont.css'
import "v-contextmenu/dist/themes/default.css";
import 'element-plus/dist/index.css'
import 'animate.css'; //动画库
import ElementPlus from 'element-plus'
import VContentment from "v-contextmenu";
import * as ElementPlusIconsVue from '@element-plus/icons-vue'
import router from "./route.js";
import {registerTools} from "./tools.js";
import draggable from "vuedraggable";
import pina from "./pinia";
import {VSize} from "./directives/v_size";
import {registerIcon} from "./icons";
import {registerSettingComponent} from "./setting";


const app: App = createApp(App)

app.use(pina)
app.use(VContentment)
app.use(ElementPlus)
for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
    app.component(key, component)
}
// 注册 拖拽组件
app.component(draggable.name, draggable)
// 注册全局图标
registerIcon(app)
// 注册全局组件
registerTools(app)
// 注册额设置组件
registerSettingComponent(app)


app.directive('size', VSize)

// 加载路由
app.use(router)


app.mount('#app')
